package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Orders;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作订单表相关数据接口
 */
public interface OrdersMapper extends BaseMapper<Orders> {

    int updateById(Orders orders);

    Orders selectById(Integer id);

    List<Orders> selectAll(Orders orders);

    List<Orders> selectAllRider(Orders orders);

    @Select("select * from orders where business_id = #{id} and (status = '待评价' or status = '已完成')")
    List<Orders> selectUsageByBusinessId(Integer id);

    List<Orders> availableForRider(Orders orders);

}